﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace JzSport.Api
{
    public static class ActionFactory
    {
        public static IAction GetAction(SysParameters sysPrameters)
        {
            if (string.Equals(sysPrameters.Command, "loginbyphone", StringComparison.CurrentCultureIgnoreCase))
            {
                return new LoginByPhoneAction();
            }
            if (string.Equals(sysPrameters.Command, "registerbyphone", StringComparison.CurrentCultureIgnoreCase))
            {
                return new RegisterByPhoneAction();
            }
            if (string.Equals(sysPrameters.Command, "sendverifycode4registerbyphone", StringComparison.CurrentCultureIgnoreCase))
            {
                return new SendVerifycode4RegisterByPhoneAction();
            }
            if (string.Equals(sysPrameters.Command, "sendverifycode4forgottenpassword", StringComparison.CurrentCultureIgnoreCase))
            {
                return new SendVerifycode4ForgottenPasswordAction();
            }
            if (string.Equals(sysPrameters.Command, "changepassword", StringComparison.CurrentCultureIgnoreCase))
            {
                return new ChangePasswordAction();
            }
            #region settings
            if (string.Equals(sysPrameters.Command, "ChangeAvatar", StringComparison.CurrentCultureIgnoreCase))
            {
                // 修改头像
                return new ChangeAvatarAction();
            }
            if (string.Equals(sysPrameters.Command, "EditProfile", StringComparison.CurrentCultureIgnoreCase))
            {
                // 修改用户的名称
                return new EditProfileAction();
            }
            //if (string.Equals(sysPrameters.Command, "ChangeName", StringComparison.CurrentCultureIgnoreCase))
            //{
            //    // 修改用户的名称
            //    return new ChangeNameAction();
            //}
            //if (string.Equals(sysPrameters.Command, "ChangeSex", StringComparison.CurrentCultureIgnoreCase))
            //{
            //    // 修改用户的性别
            //    return new ChangeSexAction();
            //}
            
            #endregion
            if (string.Equals(sysPrameters.Command, "changepassword4forgottenpassword", StringComparison.CurrentCultureIgnoreCase))
            {
                return new ChangePassword4ForgottenPasswordAction();
            }
            if (string.Equals(sysPrameters.Command, "uploadimageresource", StringComparison.CurrentCultureIgnoreCase))
            {
                return new UploadImageResourceAction();
            }
            #region activity
            if (string.Equals(sysPrameters.Command, "createactivity", StringComparison.CurrentCultureIgnoreCase))
            {
                // 创建活动
                return new CreateActivityAction();
            }
            if (string.Equals(sysPrameters.Command, "GetPromotionalActivityList", StringComparison.CurrentCultureIgnoreCase))
            {
                // 获取默认的推广活动列表
                return new GetPromotionalActivityListAction();
            }
            if (string.Equals(sysPrameters.Command, "GetDefaultActivityList", StringComparison.CurrentCultureIgnoreCase))
            {
                // 获取默认的活动列表
                return new GetDefaultActivityListAction();
            }
            if (string.Equals(sysPrameters.Command, "GetActivityListByCategory", StringComparison.CurrentCultureIgnoreCase))
            {
                // 获取默认的活动列表
                return new GetActivityListByCategoryAction();
            }
            if (string.Equals(sysPrameters.Command, "GetActivity", StringComparison.CurrentCultureIgnoreCase))
            {
                // 获取默认的活动列表
                return new GetActivityAction();
            }
            if (string.Equals(sysPrameters.Command, "FeedbackActivity", StringComparison.CurrentCultureIgnoreCase))
            {
                // 反馈活动
                return new FeedbackActivityAction();
            }
            if (string.Equals(sysPrameters.Command, "GetActivityFeedbackList", StringComparison.CurrentCultureIgnoreCase))
            {
                // 获取反馈列表
                return new GetActivityFeedbackListAction();
            }
            if (string.Equals(sysPrameters.Command, "AuditingJoinActivityRequest", StringComparison.CurrentCultureIgnoreCase))
            {
                return new AuditingJoinActivityRequestAction();
            }
            if (string.Equals(sysPrameters.Command, "JoinActivity", StringComparison.CurrentCultureIgnoreCase))
            {
                return new JoinActivityAction();
            }
            if (string.Equals(sysPrameters.Command, "LeaveActivity", StringComparison.CurrentCultureIgnoreCase))
            {
                return new LeaveActivityAction();
            }
            if (string.Equals(sysPrameters.Command, "GetActivityMemberList", StringComparison.CurrentCultureIgnoreCase))
            {
                return new GetActivityMemberListAction();
            }
            if (string.Equals(sysPrameters.Command, "GetActivityImageList", StringComparison.CurrentCultureIgnoreCase))
            {
                return new GetActivityImageListAction();
            }
            #endregion
            #region friends
            if (string.Equals(sysPrameters.Command, "SendFriendsRequest", StringComparison.CurrentCultureIgnoreCase))
            {
                // 发送好友申请
                return new SendFriendsRequestAction();
            }
            if (string.Equals(sysPrameters.Command, "AcceptFriendsRequest", StringComparison.CurrentCultureIgnoreCase))
            {
                // 同意好友申请
                return new AcceptFriendsRequestAction();
            }
            if (string.Equals(sysPrameters.Command, "RejectFriendsRequest", StringComparison.CurrentCultureIgnoreCase))
            {
                // 拒绝好友申请
                return new RejectFriendsRequestAction();
            }
            if (string.Equals(sysPrameters.Command, "GetFriendsList", StringComparison.CurrentCultureIgnoreCase))
            {
                // 获取好友列表
                return new GetFriendsListAction();
            }
            if (string.Equals(sysPrameters.Command, "DeleteFriends", StringComparison.CurrentCultureIgnoreCase))
            {
                // 删除好友
                return new DeleteFriendsAction();
            }
            #endregion
            #region message
            if (string.Equals(sysPrameters.Command, "getMessageClipList", StringComparison.CurrentCultureIgnoreCase))
            {
                return new GetMessageClipListAction();
            }
            if (string.Equals(sysPrameters.Command, "SendMessageToUser", StringComparison.CurrentCultureIgnoreCase))
            {
                return new SendMessageToUserAction();
            }
            if (string.Equals(sysPrameters.Command, "GetInstantMessageList", StringComparison.CurrentCultureIgnoreCase))
            {
                return new GetInstantMessageListAction();
            }
            if (string.Equals(sysPrameters.Command, "SendMessageToActivity", StringComparison.CurrentCultureIgnoreCase))
            {
                return new SendMessageToActivityAction();
            }
            if (string.Equals(sysPrameters.Command, "GetInstantMessageList4Activity", StringComparison.CurrentCultureIgnoreCase))
            {
                return new GetInstantMessageList4ActivityAction();
            }
            if (string.Equals(sysPrameters.Command, "GetNewMessageCount4User", StringComparison.CurrentCultureIgnoreCase))
            {
                return new GetNewMessageCount4UserAction();
            }
            if (string.Equals(sysPrameters.Command, "DeleteMessageClip", StringComparison.CurrentCultureIgnoreCase))
            {
                return new DeleteMessageClipAction();
            }
            if (string.Equals(sysPrameters.Command, "DeleteMessage", StringComparison.CurrentCultureIgnoreCase))
            {
                return new DeleteMessageAction();
            }
            
            #endregion
            #region user's activity
            if (string.Equals(sysPrameters.Command, "GetActivityList4User", StringComparison.CurrentCultureIgnoreCase))
            {
                return new GetActivityList4UserAction();
            }
            if (string.Equals(sysPrameters.Command, "GetActivityCount4User", StringComparison.CurrentCultureIgnoreCase))
            {
                return new GetActivityCount4UserAction();
            }
            //if (string.Equals(sysPrameters.Command, "GetFinishedActivityList4User", StringComparison.CurrentCultureIgnoreCase))
            //{
            //    return new GetFinishedActivityList4UserAction();
            //}
            //else if(string.Equals(sysPrameters.Command, "GetUnfinishedActivityList4User", StringComparison.CurrentCultureIgnoreCase))
            //{
            //    return new GetUnfinishedActivityList4UserAction();
            //}
            #endregion
            #region other's activity
            if (string.Equals(sysPrameters.Command, "GetActivityList4Other", StringComparison.CurrentCultureIgnoreCase))
            {
                return new GetActivityList4OtherAction();
            }
            if (string.Equals(sysPrameters.Command, "GetActivityCount4Other", StringComparison.CurrentCultureIgnoreCase))
            {
                return new GetActivityCount4OtherAction();
            }
            //if (string.Equals(sysPrameters.Command, "GetFinishedActivityList4User", StringComparison.CurrentCultureIgnoreCase))
            //{
            //    return new GetFinishedActivityList4UserAction();
            //}
            //else if(string.Equals(sysPrameters.Command, "GetUnfinishedActivityList4User", StringComparison.CurrentCultureIgnoreCase))
            //{
            //    return new GetUnfinishedActivityList4UserAction();
            //}
            #endregion
            #region basedata
            if (string.Equals(sysPrameters.Command, "GetBaseDataItemList", StringComparison.CurrentCultureIgnoreCase))
            {
                return new GetBaseDataItemListAction();
            }
            if (string.Equals(sysPrameters.Command, "GetBaseDataSummary", StringComparison.CurrentCultureIgnoreCase))
            {
                return new GetBaseDataSummaryAction();
            }
            #endregion
            if (string.Equals(sysPrameters.Command, "searchuser", StringComparison.CurrentCultureIgnoreCase))
            {
                return new SearchUserAction();
            }
            return null;
        }
    }
}
